import * as React from "react"
import { BidProjectsContainer } from "@/components/bidding-projects/bid-projects-container"
import { Shell } from "@/components/shell"
import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton"
import { useTranslation } from "@/i18n"

// Layout 컴포넌트는 서버 컴포넌트입니다
export default async function BidProjectsLayout({
  params,
  children,
}: {
  params: Promise<{ lng: string }>
  children: React.ReactNode
}) {
  const { lng } = await params
  const { t } = await useTranslation(lng, 'menu')
  
  // 프로젝트 타입 정의
  const projectTypes = [
    { id: "all", name: t('common.all') || "전체" },
    { id: "SHIP", name: t('groups.shipbuilding') },
    { id: "TOP", name: `${t('groups.offshore')} TOP` },
    { id: "HULL", name: `${t('groups.offshore')} HULL` },
  ]

  return (
    <Shell className="gap-4">
      <React.Suspense
        fallback={
          <DataTableSkeleton
            columnCount={6}
            searchableColumnCount={1}
            filterableColumnCount={2}
            cellWidths={["10rem", "40rem", "12rem", "12rem", "8rem", "8rem"]}
            shrinkZero
          />
        }
      >
        <BidProjectsContainer lng={lng} projectTypes={projectTypes}>
          {children}
        </BidProjectsContainer>
      </React.Suspense>
    </Shell>
  )
} 